home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / edit.167 < prev    next >
Text File  |  1992-02-06  |  3KB  |  45 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw11460
  3. \paperh9000
  4. \margl120
  5. \margr120
  6. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\tx5860\tx6400\tx6920\tx7460\tx8000\tx8540\f0\b0\i0\ul0\fs28 edit RTF formatting \
  7. \
  8. Q:  How can I view the Shakespeare files (or any RTF files for that matter) as normal text?   When I look at the file using emacs or vi, I see all sorts of embedded format directives.\
  9. \
  10. A:  The Shakespeare files are in Microsoft Rich Text Format (RTF).   RTF files are filled with curly braces and usually begin with the characters:
  11. \f3\fs24 "\{\\rtf0
  12. \f1 " .  
  13. \f0\fs28 The Text Object in the Application Kit knows about RTF; thus any program using the Text class should be able to read and write RTF files. \
  14. \
  15. The Digital Librarian will properly interpret and display RTF files.  If you select the file name in the summary area, the file is displayed in the text area below with the correct formatting and fonts.  \
  16. \
  17. Edit also understands RTF formatting, and you can open RTF files in Edit.  If you wish to remove the formatting, you can copy rich text from the file, and paste that text into a new window.  By default, Edit windows are plain text, and by pasting rich text into a plain-text window, you will strip out the embedded RTF instructions.   (If you wanted to preserve the RTF when copying and pasting, you could make the second window into an RTF window before pasting, by choosing Text from the Format menu, then choosing Make Rich Text from the Text menu.)\
  18. \
  19. Another way to convert RTF files into plain text is to run the following command in a shell:\
  20. \
  21.  
  22. \f3\fs24     /usr/lib/indexing/rtf-ascii < 
  23. \i rtfFile
  24. \i0  >  
  25. \i plainFile
  26. \i0 \
  27. \
  28.  
  29. \f0\fs28 where 
  30. \i rtfFile
  31. \i0  is the name of the original RTF file and 
  32. \i plainFile
  33. \i0  is the text file to be created.\
  34. \
  35. Edit has a Preferences setting for RTF.   Choose Preferences from the Info menu, then choose Temporary Settings from the pop-up list in the Preferences panel.  The radio button labeled 
  36. \pard Edit Rich Text Format
  37. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\tx5860\tx6400\tx6920\tx7460\tx8000\tx8540  enables rich text formatting (the default), while Ignore Rich Text  Format opens RTF files as plain ASCII, showing you all the formatting commands.  The latter mode can sometimes be useful if you want to edit the RTF commands—for example, to remove inappropriate commands from RTF files created on another brand of computer.\
  38. \
  39. QA167\
  40. \
  41. Valid for 1.0 \
  42. Valid for 2.0\
  43. \
  44.  
  45.